package vista;

import java.awt.Color;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.JTable;
import javax.swing.JButton;
import javax.swing.SwingUtilities;

import modelo.dao.DAO;
import controlador.Controlador;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class PanelCaja extends JPanel {
	private JTable table;
	private JTable table_1;
	private DAO dao;
	private Controlador controlador;
	private JPanel actual;

	/**
	 * Create the panel.
	 */
	public PanelCaja(DAO d, Controlador c) {
		setBackground(Color.GRAY);
		setLayout(null);
		setSize(1024,768);
		this.actual = this;
		this.dao = d;
		this.controlador = c;
		
		JLabel lblCuentasDelDia = new JLabel("Cuentas del D\u00EDa");
		lblCuentasDelDia.setHorizontalAlignment(SwingConstants.CENTER);
		lblCuentasDelDia.setBounds(71, 46, 114, 14);
		add(lblCuentasDelDia);
		
		table = new JTable();
		table.setBounds(10, 71, 306, 511);
		add(table);
		
		table_1 = new JTable();
		table_1.setBounds(489, 71, 306, 511);
		add(table_1);
		
		JLabel lblCuenta = new JLabel("Cuenta");
		lblCuenta.setHorizontalAlignment(SwingConstants.CENTER);
		lblCuenta.setBounds(615, 46, 114, 14);
		add(lblCuenta);
		
		JButton btnCerrarCaja = new JButton("Cerrar Caja");
		btnCerrarCaja.setBounds(326, 197, 153, 94);
		add(btnCerrarCaja);
		
		JButton btnVolver = new JButton("Volver");
		btnVolver.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Ventana topFrame = (Ventana) SwingUtilities.getWindowAncestor(actual);
				JPanel next = new PanelSalon(dao, controlador);
				topFrame.setContentPane(next);
			}
		});
		btnVolver.setBounds(326, 302, 153, 94);
		add(btnVolver);
	}
}
